package testIO;

import java.io.*;
import java.util.Scanner;

public class TestInput {
    public static void main(String[] args) throws IOException {
        try (InputStream inputStream = new FileInputStream("stream.txt")) {
            Scanner scanner = new Scanner(inputStream);
            String s = scanner.next();
            System.out.println(s);
        }
    }
    public static void main1(String[] args) throws IOException {
        try (InputStream inputStream = new FileInputStream("stream.txt")) {
            byte[] buffer = new byte[1024];
            int n = inputStream.read(buffer);
            System.out.println("n = " + n);
            for (int i = 0; i < n; i++) {
                System.out.printf("%x\n", buffer[i]);
            }
        }
    }
}
